let user = {
    username: '',
    email: '',
    avatarUrl: '',
    token: '' // jwt
}

export const setUser = (userInfo) => {
    user = userInfo
    console.log(user);
}

export const getUser = () => {
    return user
}

export const delUser = () => {
    user = {
        username: '',
        email: '',
        avatarUrl: '',
        token: '' // jwt
    }
}

export const uptUser = (newUser) => {
    user = {
        ...user,
        ...newUser
    }
}

let userPlaylist = []

export const setUserPlaylist = (userPlaylistInfo) => {
    userPlaylist = userPlaylistInfo
    console.log(userPlaylist);
}

export const getUserPlaylist = () => {
    return userPlaylist
}
